# -*- coding: utf-8 -*-
"""
Created on Wed Apr  8 22:13:23 2020

@author: wjx
"""

class StarkConfig(object):
    def __init__(self,name,age):
        self.name = name
        self.age = age
        
class AdminSite(object):
    def __init__(self):
        self.data_list = []
        self.sk = None
        
    def set_sk(self,arg):
        self.sk = arg
        
site = AdminSite()  #data_list = []   sk = None
site.set_sk(StarkConfig) #sk=StarkConfig
site.sk('alex',19) 
#------------------------------------------------------
class Foo(object):
    def __init__(self):
        print('给对象赋值')
        self.x = 123
    def __new__(cls):
        print('创建对象')
        return object.__new__(cls)
obj = Foo()
#------------------------------------------------------
class Goo:
    def __enter__(self):
        print('enter')
        
    def __exit__(self,exc_type,exc_val,exc_tb):
        print('exit')
        
with Goo():
    print(123)